s1=input().strip()
s2=input().strip()
s3=s1
s3=s3.lower()
s2=s2.lower()
while s2 in s3:
    s3=s3.replace(s2,"",1000)
print("result: ",end='')
for i in s1:
    if (i.lower() in s3) or( i.upper() in s3) :
        print(i,end='')